local xiongji = fk.CreateSkill{
  name = "lingling__xiongji",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["lingling__xiongji"] = "凶极",
  [":lingling__xiongji"] = "锁定技，当你造成或受到伤害时，若你手牌唯一最多则伤害+1，否则你摸一张牌。",
}

local spec = {
  anim_type = "offensive",
  on_use = function(self, event, target, player, data)
    if table.every(player.room:getOtherPlayers(player, false), function(p)
      return player:getHandcardNum() > p:getHandcardNum()
    end) then
      data:changeDamage(1)
    else
      player:drawCards(1, xiongji.name)
    end
  end,
}

xiongji:addEffect(fk.DamageCaused, spec)
xiongji:addEffect(fk.DamageInflicted, spec)

return xiongji
